package com.zzyl;


import org.junit.jupiter.api.Test;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component// 将类交给spring管理
public class task {

    /**
     * 定时任务 每隔5秒执行一次
     */
    @Scheduled(cron = "0/5 * * * * ?")
    @Test
    public void test(){
        System.out.println("定时任务执行了");
    }

}
